import { currentUserID } from "@/utils/common.js";
import { utils } from 'hi-ui';
export default {
    id: "DrugEntity",
    returnTotal:true,
    modelFile: "grade/dataset/GradeEntity.xml",
    sortFields: [
        "FID",
        "FDESC",
        "FINTEGRAL",
        "FDISCOUNT",
        "FDISCOUNTOBJ",
        "FCONSUME",
        "FACCUMULATE",
        "FENTERPRISEDESC",
        "FENTERPRISEID",
        "FCREATEDATE",
        "FUSERID",
    ],
    fields: {
        FID: {
            name: "FID", //字段ID
            label: "ID", //字段描述
            dbtype: "dbString", //数据类型
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.guid();
                },
            },
        },
        FDESC: {
            name: "FDESC", //字段ID
            label: "等级名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
        },
        FINTEGRAL: {
            name: "FINTEGRAL", //字段ID
            label: "升级积分", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
        },
        FDISCOUNT: {
            name: "FDISCOUNT", //字段ID
            label: "折扣", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
        },
        FDISCOUNTOBJ: {
            name: "FDISCOUNTOBJ", //字段ID
            label: "对应等级折扣", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FCONSUME: {
            name: "FCONSUME", //字段ID
            label: "每消费", //字段描述
            dbtype: "dbInt", //数据类型
        },
        FACCUMULATE: {
            name: "FACCUMULATE", //字段ID
            label: "累计积分", //字段描述
            dbtype: "dbInt", //数据类型
        },
        FENTERPRISEDESC: {
            name: "FENTERPRISEDESC", //字段ID
            label: "企业名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEID: {
            name: "FENTERPRISEID", //字段ID
            label: "企业ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FCREATEDATE: {
            name: "FCREATEDATE", //字段ID
            label: "创建时间", //字段描述
            dbtype: "dbDate", //数据类型
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },
        },
        FUSERID: {
            name: "FUSERID", //字段ID
            label: "创建人", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return currentUserID();
                },
            },
        }
    }
}
